package com.calvin.spring.annotation;

import com.calvin.spring.controller.UserController;
import com.calvin.spring.repository.UserRepositoryImpl;
import com.calvin.spring.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans-annotation.xml");
//        TestAnnotation testAnnotation = (TestAnnotation) context.getBean("testAnnotation");
//        System.out.println(testAnnotation);

        UserController userController = (UserController) context.getBean("userController");
        System.out.println(userController);
        userController.execute();

//        UserService userService = (UserService) context.getBean("userService");
//        System.out.println(userService);
//
//        UserRepositoryImpl userRepository = (UserRepositoryImpl) context.getBean("userRepository");
//        System.out.println(userRepository);
    }
}
